import { BasicColumn, FormSchema } from '@apps/antd-admin/src/components/Table';
import {render} from "@apps/antd-admin/src/hooks/render/renderUtils";
import { RenderType } from '@pkg/setting';

export const columns: BasicColumn[] = [
  {
    title: '优惠券标题',
    dataIndex: 'couponTitle',
    width: 100,
  },
  {
    title: '领取人',
    dataIndex: 'userName',
    width: 100,
  },
  {
    title: '开始时间',
    dataIndex: 'userExpireBeginDate',
    width: 100,
  },
  {
    title: '过期时间',
    dataIndex: 'userExpireEndDate',
    width: 100,
  },
  {
    title: '使用时间',
    dataIndex: 'useTime',
    width: 100,
  },
  {
    title: '状态',
    dataIndex: 'useState',
    width: 100,
    dictData: [
      { label: '未使用', value: 0},
      { label: '已使用', value: 1 },
      { label: '已过期', value: 2 },
    ],
    renderType: RenderType.DICT,
  },
  {
    title: '领取时间',
    dataIndex: 'createTime',
    width: 130,
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'userName',
    label: '用户名',
    component: 'Input',
    colProps: { span: 12 },
  },
];
